// detail.js
Page({
  data: {
    region: ['广东省', '广州市', '海珠区'],
    customItem: '全部',
    goods_pic:'',
    goods_score:'',
    goods_title:'',
    goods_desc:'',
    goods_id:'',
  },
  bindRegionChange: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      region: e.detail.value
    })
  },
  /**
 * 生命周期函数--监听页面加载
 */
  onLoad: function (options) {
    var that = this;
    that.setData({
      goods_id: options.goods_id
    })
    var goods_id = this.goods_id
    var app = getApp();
    wx.request({
      url: app.globalData.domain + '/askforum/detail',
      method: 'POST',
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      dataType: 'json',
      data: {
       goods_id:goods_id,
      },
      success: function (res) {
        that.setData({
          goods_desc: res.data.result.goods_desc,
          goods_score: res.data.result.goods_score,
          goods_title: res.data.result.goods_title,
          goods_id: res.data.result.id,
          goods_pic: res.data.result.goods_pic,
        })

      }
    })
  },

})